<template>
  <div class="book-content">
    <div class="capter-list">
      <div
        v-for="(item, index) in chapter"
        :key="index"
        class="item">
        <span @click="getDetail(item)">{{item.label}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { getWebChapter, laodWebXS } from '@/plugins/book.js'
export default {
  name: '',
  mixins: [],
  props: {},
  components: {},
  data () {
    return {
      chapter: []
    }
  },
  watch: {},
  computed: {},
  created () {},
  mounted () {
    laodWebXS()
    getWebChapter().then(res => {
      this.chapter = res
      console.log(this.chapter)
    })
  },
  methods: {
    getDetail (item) {
      this.$router.push({
        path: '/bookdetail',
        query: {
          link: item.link,
          label: item.label
        }
      })
    }
  }
}
</script>

<style scoped lang="scss">
.book-content {
  color: rgba(126, 123, 123, 0.7);
  font-size: 16px;
  .capter-list {
    .item {
      margin: 2px 0;
    }
  }
}
</style>
